

use PTA_JCR_replication.dta, clear

**Table 2
*column 1:
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe  

*figure 1: left panel
interflex numPTAsigned v2exl_legitideolcr_0 v2x_polyarchy signPTAspl lnpcGDP lnGDP lntradeopennm nPTAcount_desta, fe(ccode year) title("DESTA PTA data") xlab("Regime Type") ylab("PTA Signings") dlab("Nationalism") 

**column 2:
xtreg MM_PTAsign_count c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_MM signPTAmmspl i.year, fe 

*figure 2: right panel
interflex MM_PTAsign_count v2exl_legitideolcr_0 v2x_polyarchy signPTAmmspl lnpcGDP lnGDP lntradeopennm nPTAcount_MM, fe(ccode year) title("Mansfield-Milner PTA data") xlab("Regime Type") ylab("PTA Signings") dlab("Nationalism")

** populism 
*column 3:
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy i.populist##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe 

*column 4:
xtreg MM_PTAsign_count c.v2exl_legitideolcr_0##c.v2x_polyarchy i.populist##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_MM signPTAmmspl i.year, fe 


** Table 3
**logit model: column 1
xi i.year
xtlogit signPTA c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl _Iyear_1951 _Iyear_1955-_Iyear_1970 _Iyear_1972-_Iyear_1977 _Iyear_1979-_Iyear_1986 _Iyear_1988-_Iyear_2018, fe 

**DPI data: column 2
xtreg numPTAsigned execnat##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe 

*no EU: column 3
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year if europeanunion~=1, fe

*post-CW: column 4
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year if year>=1989, fe

*no OECD: column 5
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year if OECD~=1, fe


**table 4 (c1-c4)
*WB competition control: column 1
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy  lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl WB_PTA i.year, fe 

**Delta expports: column 2
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl d.WTOexportspct i.year, fe 

*pct change GDP: column 3
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl pctGDP1 i.year , fe

*military conflict: column 4
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl n_disputes i.year , fe

**table 4 (c5-c8)
*veto players: column 5
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl polconiii i.year, fe

*Idealpoint: column 6
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl Idealpoint i.year, fe

*DMZ: column 7

xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl DMZ1 i.year, fe

**backsliding: column 8
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl d.v2x_polyarchy i.year, fe


**Table 5: Alternative outcomes
**IMF Trade restrictions: column 1
xtreg trade_restr c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTA i.year, fe

interflex trade_restr v2exl_legitideolcr_0 v2x_polyarchy lnpcGDP lnGDP signPTA lntradeopennm nPTAcount_desta, fe(ccode year) title("Trade Restrictions") xlab("Regime Type") ylab("Trade Restrictions") dlab("Nationalism") 

**PTA negotiation start: column 2

xi i.year
xtlogit start_negot_dum c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTA _Iyear_1953 _Iyear_1955-_Iyear_1961 _Iyear_1963-_Iyear_1967 _Iyear_1969-_Iyear_1974 _Iyear_1976-_Iyear_1983 _Iyear_1985 _Iyear_1986 _Iyear_1988-_Iyear_2017, fe 

interflex start_negot_dum v2exl_legitideolcr_0 v2x_polyarchy signPTA lnpcGDP lnGDP lntradeopennm nPTAcount_desta _Iyear_1953 _Iyear_1955-_Iyear_1961 _Iyear_1963-_Iyear_1967 _Iyear_1969-_Iyear_1974 _Iyear_1976-_Iyear_1983 _Iyear_1985 _Iyear_1986 _Iyear_1988-_Iyear_2017, fe(ccode) title("PTA Negotiation Starts") xlab("Regime Type") ylab("PTA Negotiations") dlab("Nationalism")

*Appendix A-2: Culumn 1
xtreg f.numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe 

*Appendix A-2: Column 2
xtreg f.MM_PTAsign_count c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_MM signPTAspl i.year, fe 


**additional robustness checks noted in text

* populist runs mentioned in text
*are existing results conditional on populism?
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl populist i.year, fe 

*onset of populist leader
xtreg numPTAsigned c.v2exl_legitideolcr_0##c.v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl poptakeover i.year, fe


***additional endogneiety runs mentioned in text
xtreg v2exl_legitideolcr_0 numPTAsigned v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe 

*with LEV (not noted in text)
xtreg v2exl_legitideolcr_0 l.v2exl_legitideolcr_0 numPTAsigned v2x_polyarchy lnpcGDP lnGDP lntradeopennm nPTAcount_desta signPTAspl i.year, fe 

